package com.bourne.controller;

import com.bourne.model.BaseDictDO;
import com.bourne.request.DictRequest;
import com.bourne.service.impl.BaseDictServiceImpl;
import com.bourne.util.JsonData;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @version 1.0
 * @ClassName BaseDictController
 * @Description
 * @Author denny
 * @Date 2023/3/10 15:23
 */
@RestController
@RequestMapping("/api/dict/v1")
@Slf4j
@CrossOrigin
@Api(tags = "字典模块")
@RefreshScope
public class BaseDictController extends BaseCoreController<BaseDictServiceImpl, BaseDictDO> {


    @PostMapping("add")
    public JsonData add(@Validated @RequestBody DictRequest dictRequest) {
        return service.add(dictRequest);
    }

    @PostMapping("pageList")
    public JsonData pageList(@RequestBody DictRequest dictRequest) {
        return service.pageList(dictRequest);
    }
}
